<template>
       <div class="app1">
        <h4>父组件1</h4>
        <h4>汽车：{{ car }}</h4>
        <h4 v-show="toy">子传的玩具：{{ toy }}</h4>
    <!-- 向子组件发送数据 -->
        <Zprops :car="car" :sendToy="getToy"/>
       </div>
</template>
    
<script setup lang='ts'>
import Zprops from './Zprops.vue';
import { ref } from 'vue';

let car = ref('奔驰')
let toy = ref('')

function getToy(value:string) {
       toy.value = value  
    }
</script>
    
<style scoped>
    .app1{
        width: 80%;
        padding: 20px;
        background-color: bisque;
        font-size: 17px;
        border-radius: 5px;
    }
</style>